﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Crossborder.Core.Migrations
{
    /// <inheritdoc />
    public partial class _25081101log : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<decimal>(
                name: "Price",
                table: "ProductSpecs",
                type: "decimal(18,3)",
                precision: 18,
                scale: 3,
                nullable: true,
                comment: "价格（保留后3位）",
                oldClrType: typeof(double),
                oldType: "float(18)",
                oldPrecision: 18,
                oldScale: 3,
                oldNullable: true,
                oldComment: "价格（保留后3位）");

            migrationBuilder.CreateTable(
                name: "OrderMaster",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false, comment: "主键Id")
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderMasterGuid = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "订单Guid"),
                    OrderNo = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "订单号"),
                    UserId = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "用户Id"),
                    InputDate = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "下单时间"),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "备注"),
                    Address = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "邮寄地址"),
                    PayState = table.Column<int>(type: "int", nullable: false, comment: "支付状态：0 待支付，1 已支付，2 已取消"),
                    CreateDate = table.Column<DateTime>(type: "dateTime2", nullable: false, comment: "创建时间"),
                    ModifyDate = table.Column<DateTime>(type: "dateTime2", nullable: false, comment: "修改时间"),
                    IsEnabled = table.Column<bool>(type: "bit", nullable: false, comment: "是否启用"),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_OrderMaster", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "OrderMaster");

            migrationBuilder.AlterColumn<double>(
                name: "Price",
                table: "ProductSpecs",
                type: "float(18)",
                precision: 18,
                scale: 3,
                nullable: true,
                comment: "价格（保留后3位）",
                oldClrType: typeof(decimal),
                oldType: "decimal(18,3)",
                oldPrecision: 18,
                oldScale: 3,
                oldNullable: true,
                oldComment: "价格（保留后3位）");
        }
    }
}
